package com.authorization.project.authorization.service.impl;

import java.util.List;

import com.authorization.common.utils.DateUtils;
import com.authorization.common.utils.SecurityUtils;
import net.sf.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.authorization.project.authorization.mapper.AuthorizationHistoryMapper;
import com.authorization.project.authorization.domain.AuthorizationHistory;
import com.authorization.project.authorization.service.IAuthorizationHistoryService;

/**
 * 授权注册信息Service业务层处理
 * 
 * @author 李晓雷
 * @date 2020-04-26
 */
@Service
public class AuthorizationHistoryServiceImpl implements IAuthorizationHistoryService 
{
    @Autowired
    private AuthorizationHistoryMapper authorizationHistoryMapper;

    /**
     * 查询授权注册信息
     * 
     * @param id 授权注册信息ID
     * @return 授权注册信息
     */
    @Override
    public AuthorizationHistory selectAuthorizationHistoryById(Long id)
    {
        AuthorizationHistory authorizationHistory = authorizationHistoryMapper.selectAuthorizationHistoryById(id);
        return authorizationHistory;
    }

    /**
     * 查询授权注册信息列表
     * 
     * @param authorizationHistory 授权注册信息
     * @return 授权注册信息
     */
    @Override
    public List<AuthorizationHistory> selectAuthorizationHistoryList(AuthorizationHistory authorizationHistory)
    {
        return authorizationHistoryMapper.selectAuthorizationHistoryList(authorizationHistory);
    }

    /**
     * 新增授权注册信息
     * 
     * @param authorizationHistory 授权注册信息
     * @return 结果
     */
    @Override
    public int insertAuthorizationHistory(AuthorizationHistory authorizationHistory)
    {
        return authorizationHistoryMapper.insertAuthorizationHistory(authorizationHistory);
    }

    /**
     * 修改授权注册信息
     * 
     * @param authorizationHistory 授权注册信息
     * @return 结果
     */
    @Override
    public int updateAuthorizationHistory(AuthorizationHistory authorizationHistory)
    {
        authorizationHistory.setUpdatetime(DateUtils.getNowDate());
        return authorizationHistoryMapper.updateAuthorizationHistory(authorizationHistory);
    }

    /**
     * 批量删除授权注册信息
     * 
     * @param ids 需要删除的授权注册信息ID
     * @return 结果
     */
    @Override
    public int deleteAuthorizationHistoryByIds(Long[] ids)
    {
        return authorizationHistoryMapper.deleteAuthorizationHistoryByIds(ids);
    }

    /**
     * 删除授权注册信息信息
     * 
     * @param id 授权注册信息ID
     * @return 结果
     */
    @Override
    public int deleteAuthorizationHistoryById(Long id)
    {
        return authorizationHistoryMapper.deleteAuthorizationHistoryById(id);
    }
}
